/**
 * 
 */
app.factory('ZModel', [
                       'NavModel',
                       'MenuModel',
                       'UserModel',
                       'EditMenuModel',function(
                    		   NavModel,
                    		   MenuModel,
                    		   UserModel,
                    		   EditMenuModel) {
	var ZModel = {
		getInstance : function() {
			var instance;
			if (this.instance) {
				return this.instance;
			} else {
				this.instance = {};
				return this.instance;
			}
		}
	};

	ZModel.getInstance().navModel = new NavModel();
//	ZModel.getInstance().urlModel = new NavModel();
	ZModel.getInstance().menuModel = new MenuModel();
	ZModel.getInstance().userModel = new UserModel();
	ZModel.getInstance().editMenuModel = new EditMenuModel();

	return ZModel;
} ]);

app.factory('NavModel', [ function() {
	return function() {
		this.allPages = [];
		this.currentPage = {};
	};
} ]);

app.factory('URLModel', [ function() {
	return function() {
		this.currentUrl = "";
	};
} ]);

app.factory('MenuModel', [ function() {
	return function() {
		this.menus = [];
	};
} ]);
app.factory('UserModel', [ function() {
	return function() {
		this.users = [];
		this.editUser = {};
		this.editTitle = "";
		this.editType = "";
	};
} ]);
app.factory('EditMenuModel',[function(){
	return function(){
		this.menus=[];
	};
}]);

